package com.gusha.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name="sys_repository")
@NamedQuery(name="SysRepository.findAll", query="SELECT s FROM SysRepository s")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysRepository implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private BigInteger id;//

	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="user_id")
	private User user;//
	
	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="warehouse_id")
	private SysWarehouse sysWarehouse;//资产ID
	
	@Column(name="product_type")
	private BigInteger productType;//
	
	@Column(name="product_name")
	private String productName;//
	
	@Column(name="product_num")
	private BigInteger productNum;//
	
	@Column(name="product_img")
	private String productImg;//
	
	@Column(name="is_check")
	private BigInteger isCheck;//
	
	@Column(name="is_delete")
	private BigInteger isDelete;//
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="add_time")
	private Date addTime;//添加时间

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public BigInteger getProductType() {
		return productType;
	}

	public void setProductType(BigInteger productType) {
		this.productType = productType;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public BigInteger getProductNum() {
		return productNum;
	}

	public void setProductNum(BigInteger productNum) {
		this.productNum = productNum;
	}

	public String getProductImg() {
		return productImg;
	}

	public void setProductImg(String productImg) {
		this.productImg = productImg;
	}

	public BigInteger getIsCheck() {
		return isCheck;
	}

	public void setIsCheck(BigInteger isCheck) {
		this.isCheck = isCheck;
	}

	public BigInteger getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(BigInteger isDelete) {
		this.isDelete = isDelete;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	
	
}
